package com.googlecode.jnarwhal.event;

/**
 * Basic Event object that contains the type and priority but nothing more in
 * detail.
 * 
 * @author Chris
 * 
 */
public class Event implements Comparable<Event> {

	/**
	 * The type of an event
	 */
	public static enum Type {
		MOUSE_MOVE, MOUSE_DOWN, MOUSE_UP
	}

	/**
	 * The priority of an event. HIGHEST means it will be called before all
	 * events with HIGH Priority and so on...
	 */
	public static enum Priority {
		HIGHEST, HIGH, NORMAL, LOW, LOWEST
	}

	private Type type;
	private Priority priority;

	/**
	 * Constructor of the basic event object. Priority will be set to NORMAL and
	 * the type is the given type.
	 * 
	 * @param type
	 */
	public Event(Type type) {
		this.type = type;
		priority = Priority.NORMAL;
	}

	/**
	 * @return the Type of this event
	 */
	public Type getType() {
		return this.type;
	}

	/**
	 * @return the Priority of this event
	 */
	public Priority getPriority() {
		return this.priority;
	}

	@Override
	public int compareTo(Event e) {
		return priority.compareTo(e.getPriority());
	}

}
